<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<link rel="import" href="../ct-commit-list.html">
<link rel="import" href="../ct-repositories.html">

<script>
(function () {

var assert = chai.assert;

describe('ct-commit-list', function() {
  describe('commit list Model', function() {
    it('returns commits', function() {
      var revisions = ['blink:158545'];
      var cl = new CTCommitList(new CTRepositories(), revisions);
      assert.lengthOf(cl.repositories, 1);
    });

    it ('returns repositories', function() {
      var revisions = ['blink:158545', 'blink:158666'];
      var cl = new CTCommitList(new CTRepositories(), revisions);
      var repos = cl.repositories;
      assert.lengthOf(repos, 1);
      assert.equal(repos[0].name, 'blink');
      assert.lengthOf(repos[0].commits, 2);
      assert.equal(repos[0].range, '158545 : 158666');
      assert.equal(repos[0].firstRevision, '158545');
      assert.equal(repos[0].lastRevision, '158666');
    });
  });
});

})();
</script>
